<!DOCTYPE html>
<html lang="en">

{include file='Public:head'}

<body data-type="widgets">
<script src="/assets/js/theme.js"></script>
<div class="am-g tpl-g">
    {include file='Public:header'}
    {include file='Public:menu2'}
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">商品类型</div>

                        </div>
                        <div class="widget-body  am-fr">

                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-6" >
                                <div class="am-form-group" >
                                    <div class="am-btn-toolbar" >
                                        <div class="am-btn-group am-btn-group-xs" >
                                            <a href="{:Url('Goods/commodityTypeAdd')}" class="am-btn am-btn-default am-btn-success" ><span class="am-icon-plus" ></span> 新增</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="am-u-sm-12">
                                <table  class="am-table am-table-compact am-table-striped tpl-table-black " id="example-r">
                                    <thead>
                                    <tr>
                                        <th>分类ID</th>
                                        <th>分类名称</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {foreach $cat_list as $k=>$v}
                                    <tr class="gradeX">
                                        <td>{$v.id}</td>
                                        <td>{$v.name}</td>
                                        <td>
                                            <div class="tpl-table-black-operation">
                                                <a href="{:url('Attributes/attributes',array('type_id'=>$v.id))}" class="btn btn-primary" title="属性列表" ><i class="fa fa-eye"></i></a>
                                                <a href="{:Url('Goods/commodityTypeAdd',array('id'=>$v.id))}" class="btn btn-primary" title="编辑"><i class="fa fa-pencil"></i></a>
                                                <a href="javascript:void(0);" onclick="shan('{$v.id}')" class="btn btn-danger" title="删除"><i class="fa fa-trash-o"></i></a>
                                            </div>
                                        </td>

                                    </tr>
                                    {/foreach}
                                    <!-- more data -->
                                    </tbody>
                                </table>
                            </div>
                            <div class="am-u-lg-12 am-cf">
                                <div class="am-fr">
                                    <ul class="am-pagination tpl-pagination">
                                        {$cat_list->render()}
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

</body>
<script src="/js/global.js"></script>
<script src="/js/myFormValidation.js"></script>
<script src="/js/myAjax.js"></script>
<script src="http://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>
<script src="/assets/js/amazeui.datatables.min.js"></script>
<script src="/assets/js/dataTables.responsive.min.js"></script>
<script src="/assets/js/app.js"></script>
<script>
    function shan(id){
        $.post("{:url('Goods/commodityTypeDelete')}",{id:id},function (res) {
            if(res.code ==200){
                alert(res.msg);
                location.reload();
            }else{
                alert(res.msg);
            }
        });

    }

</script>
</html>